<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>绝对定位</title>
    <style>
        /*  父标签为相对定位，子标签为绝对定位 */
        div {
            height: 200px;
            width: 200px;
            border: 1px solid red;
        }
        .parent {
            height: 400px;
            width: 400px;
           /* position: relative;
            left: 100px;
            top: 100px;*/
        }
        .child {
            position: absolute;
            top: 20px;
        }
    </style>
</head>
<body>
    <div class="parent">
        <div class="child"></div>
    </div>
</body>
</html>